import re
word = '''This module implements some useful functions on pathnames.\
 To read or write files see open(), and for accessing the filesystem \
 see the os module. The path parameters can be passed as either strings,\
  or bytes. Applications are encouraged to represent file names as (Unicode)\
   character strings. Unfortunately, some file names may not be representable\
    as strings on Unix, so applications that need to support arbitrary file\
     names on Unix should use bytes objects to represent path names. Vice versa,\
      using bytes objects cannot represent all file names on Windows (in the standard\
       mbcs encoding), hence Windows applications should use string objects to access all files.'''
def flip_word(marget_word:str):

    words = re.finditer("[a-zA-Z]+",marget_word)
    other_chars = re.finditer("[^a-zA-Z]+",marget_word)
    word_stat = [marget_word[word.start():word.end()] for word in words]
    character = (marget_word[other_char.start():other_char.end()] for other_char in other_chars)
    ret = ''.join((''.join(i) for i in zip(reversed(word_stat),character)))
    return ret
print(flip_word(word))


# 实现了句子的翻转，但是没有处理好标点符号的问题，可以再尝试一下。
# 而且段落的话，应该是有换行符的，不会是你这里示例里的一句话非常长